package com.design.cjm.structural.composite.example;

/**
 * @Author: Jie Ming Chen
 * @Date: 2018/9/24
 * @Version 1.0
 */
public class TestApp {

    public static void main(String[] args) {

        Composite root = new Composite("root");
        root.add(new Leaf("Leaf A"));
        root.add(new Leaf("Leaf B"));

        Composite comp = new Composite("Composite x");
        comp.add(new Leaf("Leaf XA"));
        comp.add(new Leaf("Leaf XB"));

        root.add(comp);

        root.display(1);

    }
}
